package com.okRPC.protocol;

import lombok.Getter;

/**
 * Description: This is a sample class.
 * Author: Simon
 * Date: 2023/10/10
 */
public enum MessageType {
    REQUEST((byte)1),
    RESPONSE((byte)2);

    @Getter
    private final byte type;
    MessageType(byte type){
        this.type=type;
    }

    public static MessageType findByType(byte type) {
        for(MessageType messageType:MessageType.values()){
            if(messageType.getType()==type){
                return messageType;
            }
        }
        return null;
    }
}
